<!DOCTYPE html>
<html lang="<?php echo $this->config->item('lang');?>">
  <?php include('template/head.php');?>  
  <body>
    <?php include('template/navbar_login.php');?>  

    <div class="container-fluid">
      <div class="row-fluid">
        <div class="span12">

 <?php
            switch ($error) {
                case -1://login
			?>                    
			<div class="alert">
			  <button type="button" class="close" data-dismiss="alert">×</button>
			  <strong>Usuario o clave incorrecta</strong> 
			</div>
			<?php
			break;
                case -2://registro
			?>                    
			<div class="alert">
			  <button type="button" class="close" data-dismiss="alert">×</button>
			  <strong>Error al registrarse. Usuario ya existente.</strong> 
			</div>
			<?php
                    break;
                case -3://registro
			?>                    
			<div class="alert">
			  <button type="button" class="close" data-dismiss="alert">×</button>
			  <strong>El usuario y la contraseña deben tener como mínimo 4 carácteres.</strong> 
			</div>
			<?php
                    break;
                default:
			if($registrar) { ?>                    
			<div class="alert">
			  <button type="button" class="close" data-dismiss="alert">×</button>
			  <strong>El registro se encuentra deshabilitado.</strong> 
			</div>
			<?php }
                    break;
            }
?>
  
<h2>Login</h2>
    
<form class="form-horizontal" name="login" method="post" action="<?php echo base_url(); ?>index.php">
  <div class="control-group">
    <label class="control-label" for="user">Usuario</label>
    <div class="controls">
     <input type="text" id="user" name="user" <?php if($registrar && $error>0) echo 'value="'.limpiar($_POST['user']).'"'; ?> placeholder="Usuario"/>
    </div>
  </div>
  <div class="control-group">
    <label class="control-label" for="pass">Password</label>
    <div class="controls">
      <input type="password" id="pass" name="pass" placeholder="Password">
    </div>
  </div>
  <div class="control-group">
    <div class="controls">
      <label class="checkbox">
        <input type="checkbox" id="recordarme" name="recordarme" />Recordarme
      </label>
      <button type="submit" class="btn btn-large btn-primary"  name="login" id="login" >Entrar</button>
      <!-- <button type="submit" class="btn btn-large btn-primary"  name="registrar" id="registrar">Registrar</button> -->
                   	 
    </div>
  </div>
</form>
        </div><!--/span-->
      </div><!--/row fluid-->

      <hr>

    <?php include('template/footer.php');?>
    </div><!--/.fluid-container-->
    
    <?php include('template/javascript.php');?>
  </body>
</html>

